package com.gy.spark.core.actions

import org.apache.spark.{SparkConf, SparkContext}

object Operator_firstAndTake {

  def main(args: Array[String]): Unit = {
    val conf = new SparkConf().setAppName(this.getClass.getSimpleName).setMaster("local")
    val sc = new SparkContext(conf)

    val lines = sc.textFile("spark/input/words.txt")
    lines.first().foreach(print)
    println()

    lines.take(2).foreach(println)

    sc.stop()
  }

}
